home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1990: Discy Business / Discy Business.2mg / DEV.CD / TOOLS / TECH.NOTES / IIGS / TN.IIGS.066 < prev    next >
Encoding:
Text File  |  1989-08-03  |  5.3 KB  |  113 lines  |  [04] ASCII Text (0x0000)

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. Apple IIGS
  8. #66:    ExpressLoad Philosophy
  9.  
  10. Written by:    Matt Deatherage                                 September 1989
  11.  
  12. This Technical Note discusses the ExpressLoad feature and how it relates to 
  13. the standard Loader and your application.
  14. _____________________________________________________________________________
  15.  
  16.  
  17. Speedy the Loader Helper
  18.  
  19. ExpressLoad is a GS/OS feature which is usually present with System Software 
  20. 5.0.  The system does not load it on machines with 512K or less RAM, and there 
  21. is always the chance that someone has removed it from the System directory.
  22.  
  23. ExpressLoad operates on Object Module Format (OMF) files which have been 
  24. "expressed," using either the APW tool Express (or it's MPW counterpart, 
  25. ExpressIIGS) or created that way by a linker.  Expressed files contain a 
  26. dynamic data segment named either ExpressLoad or ~ExpressLoad at the beginning 
  27. of the file. (Current versions of Express and ExpressIIGS create ~ExpressLoad 
  28. segments, which is the preferred naming convention; older versions created 
  29. ExpressLoad segments, and should be re-Expressed for future compatibility.)  
  30. This segment contains information ExpressLoad uses to load the files more 
  31. quickly than the System Loader, including such things as file offsets to 
  32. segment headers, mappings of old segment numbers to new segment numbers (these 
  33. files may have their segments rearranged for optimal performance), and file 
  34. offsets to relocation dictionaries.
  35.  
  36.  
  37. Two Loaders, Two Missions, One Function
  38.  
  39. The System Loader's function is to interpret OMF.  It takes files on disk (or 
  40. in memory) and transforms them from load files into relocated 65816 code.  It 
  41. does this very well, but in a very straightforward way.  For example, when the 
  42. System Loader sees the instruction to right-shift a value n times, it loads a 
  43. register with the value and performs a right-shift n times.
  44.  
  45. ExpressLoad has a different mission.  It relies upon the System Loader to 
  46. handle OMF in a straightforward fashion so it can concentrate upon handling 
  47. the most common OMF cases in the fastest possible way.  For example, when 
  48. asked for a specific segment in a load file, the System Loader "walks" the OMF 
  49. until it finds the desired segment.  ExpressLoad, however, goes directly to 
  50. the desired segment since an Expressed file contains precalculated offsets to 
  51. each segment in the ExpressLoad segment.
  52.  
  53. Since ExpressLoad focuses on the common things performed by the majority of 
  54. applications, it may not support those applications which rely upon certain 
  55. features of OMF or the System Loader.  In these cases, the System Loader loads 
  56. the file as is expected.
  57.  
  58. ExpressLoad always gets first crack at loading a file, and if it is an 
  59. Expressed file that ExpressLoad can handle, it loads it.  If the file is not 
  60. an Expressed file, the System Loader loads it instead.  It is the same process 
  61. when working with a file that has already been loaded (i.e., loading or 
  62. unloading segments).
  63.  
  64. Because an Expressed file is a standard OMF file with an additional segment, 
  65. Expressed files are almost fully compatible with the System Loader (although 
  66. it cannot load them any faster than before).  Refer the following section for 
  67. potential problems.
  68.  
  69.  
  70. Working With ExpressLoad
  71.  
  72. As ExpressLoad is intimate in its relationship with the System Loader, most 
  73. applications work seamlessly with it; however, there are some potential 
  74. problems about which you should be aware.
  75.  
  76.   o  Don't mix Expressed files and normal OMF files with the same user 
  77.      ID.  For example, if your application uses InitialLoad with a 
  78.      separate file, make sure that if it and your main application 
  79.      share the same user ID that they are both either Expressed files 
  80.      or normal OMF files.
  81.  
  82.   o  Don't use a user ID of zero.  In the past, use of zero told the 
  83.      System Loader to use the current user ID; however, now both the 
  84.      System Loader and ExpressLoad have a current user ID.  Be specific 
  85.      about user IDs when loading.
  86.  
  87.   o  Avoid loading and unloading segments by number.  Since Expressed 
  88.      files may have their segments rearranged, if an Expressed file is 
  89.      loaded by the System Loader, references to segments by number may 
  90.      be incorrect.
  91.  
  92.   o  Avoid using GetLoadSegInfo.  This call returns System Loader data 
  93.      structures which are not supported by ExpressLoad.
  94.  
  95.   o  Don't try to load segments in files which have not been loaded 
  96.      with the call InitialLoad.  This process was never a very good 
  97.      idea, and it is now apt to cause problems.
  98.  
  99.   o  Don't close files with a reference number of zero.  ExpressLoad 
  100.      (and now, the System Loader) keep your file open if there are 
  101.      dynamic segments, so the file won't have to be opened again to 
  102.      load them.  Closing a file with a reference number of zero may 
  103.      close your application behind the Loader's back.  (It also closes 
  104.      the resource fork of your application, which is another good 
  105.      reason not to do it.)
  106.  
  107.   o  Don't have segments that link to other files.  ExpressLoad does 
  108.      not support this type of link.
  109.  
  110.  
  111. Further Reference
  112. _____________________________________________________________________________
  113.   o  GS/OS Reference